<template>
	<view class="page">
		<view class="tabs">
			<view class="tab" :class="{ active: currentIndex === 0 }">
				<span>店铺信息</span>
			</view>
			<view class="tab" :class="{ active: currentIndex === 1 }">
				<span>资质与法人</span>
			</view>
			<view class="tab" :class="{ active: currentIndex === 2 }">
				<span>审核进度</span>
			</view>
		</view>

		<view class="pag">
			<view class="" v-if="currentIndex === 0">
				<view class="tab-content">
					<view class="input">
						<view class="title">联系人</view>
						<input class="uni-input" v-model="form.contact_name" placeholder="请输入联系人姓名" />
					</view>
					<!-- <view class="input">
						<view class="title">登录账号</view>
						<input class="uni-input" name="input" placeholder="用户登录商家端的手机号" />
					</view>
					<view class="input">
						<view class="title">登录密码</view>
						<input class="uni-input" name="input" placeholder="输入登录密码" />
					</view> -->
					<view class="input">
						<view class="title">商品分类</view>

						<picker mode="selector" :range="common.modulesData.categoryModules" range-key="name"
							@change="onCategoryChange">
							<view style="min-width: 400rpx;" class="picker-view">{{ category_name || '请选择商品分类' }}</view>
						</picker>

					</view>
					<view class="input">
						<view class="title">所属行业</view>
						<view class="bun"></view>
						<!-- <uni-data-picker class="bun" :localdata="items" popup-title="请选择所属行业"
							@nodeclick="onnodeclick" @clear="clearH"></uni-data-picker> -->
						<uni-data-picker class="bun" v-model="form.qualification_type" :localdata="items"
							popup-title="请选择所属行业"></uni-data-picker>
					</view>
					<view class="storeMainImage">
						<view class="title">店铺主图</view>

						<uni-file-picker class="ren" fileMediatype="image" mode="grid"
							@select="select($event, 'avatar')" limit="1" @delete="del" :del-icon="false"
							disable-preview />
					</view>

					<block v-if="form.spot_type == 2">
						<view class="input">
							<view class="title">可取时间</view>
							<input class="uni-input" v-model="form.time" placeholder="请输入可取时间" />
						</view>


						<view class="input">
							<view class="title">店铺位置</view>

							<view class="picker-view" style="min-width: 400rpx;" @click="onChooseAddress">
								{{ form.address || '请选择店铺位置' }}
							</view>
						</view>
					</block>

					<view class="nextStep" @click="previousStep" v-if="currentIndex != 0">上一步</view>
					<view class="nextStep1" @click="nextStepjump">下一步</view>
				</view>
			</view>
			<view class="" v-if="currentIndex === 1">
				<view class="tab-content1">
					<view class="text" v-if="form.type == 0">申请类型</view>
					<view class="optionsCardPage" v-if="form.type == 0">
						<!--            红色边框-->

						<view class="optionsCardPage1"
							@click="form.state = 0;form.subject_type='SUBJECT_TYPE_INDIVIDUAL'"
							:class="{ active: form.state === 0 }">
							个体工商户
						</view>
						<view class="optionsCardPage1"
							@click="form.state = 1;form.subject_type='SUBJECT_TYPE_ENTERPRISE'"
							:class="{ active: form.state === 1 }">
							企业/组织
						</view>
					</view>
					<view class="zitab" >
						<view>
							<view class="businessLicense" v-if="form.type == 0">营业执照和资质</view>
							<view class="pickers"v-if="form.type == 0">
								<view class="ddff">
									<uni-section title="自定义图片大小" type="line">
										<view class="example-body custom-image-box">
											<uni-file-picker limit="1" :del-icon="false"
												@select="select($event, 'license_copy')" disable-preview
												:imageStyles="imageStyles" file-mediatype="image"></uni-file-picker>
										</view>
										<view class="reddf">营业执照</view>
									</uni-section>
								</view>
							</view>
							<view class="businessLicense"v-if="form.type == 0">法人身份证</view>
							<view class="businessLicense"v-if="form.type == 1">身份证</view>
							<view class="pickers">
								<view class="ddf">
									<uni-section title="自定义图片大小" type="line">
										<view class="example-body custom-image-box">
											<uni-file-picker limit="1" :del-icon="false" disable-preview
												@select="select($event, 'contact_id_doc_copy')"
												:imageStyles="imageStyles" file-mediatype="image"></uni-file-picker>
										</view>
										<view class="reddf">人像面</view>
									</uni-section>
								</view>
								<view class="khg">
									<uni-section title="自定义图片大小" type="line">
										<view class="example-body custom-image-box">
											<uni-file-picker limit="1" :del-icon="false" disable-preview
												@select="select($event, 'contact_id_doc_copy_back')"
												:imageStyles="imageStyles" file-mediatype="image"></uni-file-picker>
										</view>
										<view class="reddf">国徽面</view>
									</uni-section>
								</view>
							</view>

							<view class="input" style="margin-top: 20rpx;">
								<view class="title">身份证开始时间</view>
								<picker mode="date" @change="change($event, 'contact_period_begin')">
									<view class="picker-view">{{ form.contact_period_begin || '身份证开始时间' }}</view>
								</picker>
							</view>
							<view class="input">
								<view class="title">身份证结束时间</view>
								<view class="" style="display: flex;justify-content: space-between;width: 65%;">
									<picker mode="date" @change="change($event, 'contact_period_end')" v-if="!isLongTerm">
										<view class="picker-view">{{ form.contact_period_end || '身份证结束时间' }}</view>
									</picker>
									<view v-else class="picker-view">{{ form.contact_period_end }}</view>
									<label class="radio">
										<radio :value="'长期'" :checked="isLongTerm" @tap="toggleLongTerm()"></radio>
										<text>长期</text>
									</label>
								</view>
								
							</view>
						</view>
					</view>

					<!-- <view v-if="currentIndexzi === 1">
              <h3>审核进度133</h3>
              <p>这是审核进度的内容。</p>
            </view> -->
				</view>

				<view class="tab-content2" v-if="form.type == 0">
					<view class="information">营业执照信息</view>
					<view class="input">
						<view class="title">统一社会信用代码</view>
						<input class="uni-input" v-model="form.license_number" placeholder="请输入统一社会信用代码" />
					</view>

					<view class="input">
						<view class="title">营业执照注册地址</view>
						<input class="uni-input" v-model="form.license_address" placeholder="请输入营业执照注册地址" />
					</view>

					<view class="input">
						<view class="title">营业执照公司名称</view>
						<input class="uni-input" v-model="form.merchant_name" placeholder="请输入营业执照公司名称" />
					</view>

					<view class="input">
						<view class="title">营业执照开始时间</view>
						<picker mode="date" @change="change($event, 'license_period_begin')">
							<view class="picker-view">{{ form.license_period_begin || '营业执照开始时间' }}</view>
						</picker>
					</view>

					<view class="input">
						<view class="title">营业执照结束时间</view>
						
						<view class="" style="display: flex;justify-content: space-between;width: 60%;">
							<picker mode="date" @change="change($event, 'license_period_end')" v-if="!isLongTerm1">
								<view class="picker-view">{{ form.license_period_end || '营业执照结束时间' }}</view>
							</picker>
							<view v-else class="picker-view">{{ form.license_period_end }}</view>
							<label class="radio">
								<radio :value="'长期'" :checked="isLongTerm1" @tap="toggleLongTerm1()"></radio>
								<text>长期</text>
							</label>
						</view>
					</view>
				</view>

				<view class="tab-content2">
					<view class="information" v-if="form.type == 0">法人信息</view>
					<view class="information" v-if="form.type == 1">个人信息</view>
					<view class="input">
						<view class="title">姓名</view>
						<input class="uni-input" v-model="form.contact_name" placeholder="请输入法人姓名" />
					</view>
					<view class="input">
						<view class="title">身份证号</view>
						<input class="uni-input" v-model="form.contact_id_number" placeholder="请输入身份证号" />
					</view>
					<view class="input">
						<view class="title">家庭地址</view>
						<input class="uni-input" v-model="form.id_card_address" placeholder="请输入家庭地址" />
					</view>
					<view class="input">
						<view class="title">手机号</view>
						<input class="uni-input" v-model="form.mobile_phone" placeholder="请输入法人手机号" />
					</view>
					<view class="input">
						<view class="title">邮箱号码 </view>
						<input class="uni-input" type="text" v-model="form.contact_email" placeholder="请输入" />
					</view>
				</view>
				<view class="tab-content3"v-if="form.type == 0">
					<view class="sho">商户号信息
						<view class="icon" style="font-weight: normal;">
							<uni-icons type="info" size="20" @click="showExp1 = !showExp1"></uni-icons>
						</view>
					</view>
					<view class="explain" v-show="showExp1">
						说明：完善下方信息后，平台将帮您注册您的微信商
						户号，用于后续的收益分账使用，请认真填写。
					</view>
				</view>
				<view class="tab-content4" >
					<view class="sho">经营信息</view>
					<view class="shjc">
						<view class="shj">商户简称 </view>
						<view class="icon"><uni-icons type="info" size="20" @click="showExp2 = !showExp2"></uni-icons>
						</view>
						<input class="oun" type="text" v-model="form.shopname" placeholder="请输入" />
					</view>
					<view class="explain" v-show="showExp2">
						1、在支付完成页向买家展示，需与微信经营类目相关。
						2、简称要求：①不支持单纯以人名来命名，若为个体户经营
						，可用“个体户+经营者名称"或"“经营者名称+业务"命名，
						如“个体户张三"或“张三餐饮店”②)不支持无实际意义的
						文案，如“XX特约商户”、“800”、 “XX客服电话XXX”;
					</view>
					<view class="shjc">
						<view class="shj">客服电话 </view>
						<view class="icon"><uni-icons type="info" size="20" @click="showExp3 = !showExp3"></uni-icons>
						</view>
						<input class="oun" type="text" v-model="form.mobile_phone" placeholder="请输入" />
					</view>
					<view class="explain" v-show="showExp3">
						1、请填写真实有效的客服电话，将在交易记录中向买家展示 ,提供咨询服务
						2、请确保电话畅通，以便入驻后平台回拨确认。
					</view>
				</view>
				<view class="tab-content5" v-if="form.type == 0">
					<view class="information">结算账户</view>
					<view class="shjh">帐户类型 </view>
					<view class="optionsCardPage">
						<view class="optionsCardPage1" @click="form.bank_account_type = 'BANK_ACCOUNT_TYPE_CORPORATE'"
							:class="{ active: form.bank_account_type === 'BANK_ACCOUNT_TYPE_CORPORATE' }">对公商户
						</view>
						<view class="optionsCardPage1" @click="form.bank_account_type = 'BANK_ACCOUNT_TYPE_PERSONAL'"
							:class="{ active: form.bank_account_type === 'BANK_ACCOUNT_TYPE_PERSONAL' }">个人储蓄卡
						</view>
					</view>
					<!-- v-if="currentIndexzi1===0" -->
					<view class="dui" style="margin-top: 20rpx;">
						<form @submit="formSubmit" @reset="formReset">
							<!-- <view class="input">
								<view class="title">账户户名</view>
								<input class="uni-input" v-model="form.bank_name" placeholder="请输入账户户名" />
							</view> -->
							<view class="input">
								<view class="title">银行账户</view>
								<input class="uni-input" v-model="form.account_number" placeholder="请输入银行账户" />
							</view>

							<view class="input">
								<view class="title">开户银行省市编码</view>
								<input class="uni-input" v-model="form.bank_address_code" placeholder="请输入开户银行省市编码" />
							</view>

							<view class="input">
								<view class="title">开户银行</view>
								<picker mode="selector" :range="bankList" :current="bankIndex"
									@change="change($event, 'account_bank')">
									<view class="picker-view">{{ form.account_bank || '请输入开户银行' }}</view>
								</picker>
								<!-- <input class="uni-input" name="input" placeholder="请输入开户银行" /> -->
							</view>

							<block>
								<view class="input">
									<view class="title">开户银行联号</view>
									<input class="uni-input" v-model="form.bank_branch_id" placeholder="请输入开户银行联号" />
								</view>

								<view class="input">
									<view class="title">开户银行全称</view>
									<input class="uni-input" v-model="form.bank_name" placeholder="请输入开户银行全称(含支行)" />
								</view>
								<view class="" style="    padding: 14px 8px;
    color: #999999;">开户银行联号与全称二选一填写</view>
							</block>

						</form>
					</view>
				</view>

				<!-- <view class="tab-content6">
					<view class="information">超级管理员</view>
					<view class="shjh">帐户类型 </view>
					<view class="optionsCardPage">
						<view class="optionsCardPage1" @click="xuangxiang3(0)"
							:class="{ active: currentIndexzi3 === 0 }">法人代表
						</view>
						<view class="optionsCardPage1" @click="xuangxiang3(1)"
							:class="{ active: currentIndexzi3 === 1 }">经办人
						</view>
					</view>
					<view class="dui">
						<form @submit="formSubmit" @reset="formReset">
							<view class="input">
								<view class="title">超管姓名</view>
								<input class="uni-input" name="input" placeholder="输入姓名" />
							</view>
							<view class="input">
								<view class="title">证件类型</view>
								<input class="uni-input" name="input" placeholder="居民身份证" />
							</view>
							<view class="input">
								<view class="title">证件号码</view>
								<input class="uni-input" name="input" placeholder="输入证件号码" />
							</view>
							<view class="shjc">
								<view class="shj">手机号码 </view>
								<view class="icon"><uni-icons type="contact" size="20"></uni-icons></view>
								<input class="oun" type="text" placeholder="请输入" />
							</view>
							<view class="explain">
								用于接收微信支付的重要管理信息及日常操作验证码，超管
								签约时可自助修改手机号，并进行短信验证超管修改手机号
								指引
							</view>
							<view class="shjc">
								<view class="shj">邮箱号码 </view>
								<view class="icon"><uni-icons type="contact" size="20"></uni-icons></view>
								<input class="oun" type="text" placeholder="请输入" />
							</view>
							<view class="explain">
								用于接收微信支付的开户邮件及日常业务通知
							</view>
						</form>
					</view>
				</view> -->
				<!-- <view class="nextStep" @click="previousStep" v-if="currentIndex != 0">上一步</view>

				<view class="nextStep1" @click="nextStepjump()" @tap="cancelOrder">下一步</view> -->
				<view class="nextStep" @click="previousStep" v-if="currentIndex != 0">上一步</view>
				<view class="nextStep1" @click="nextStepjump()" @tap="cancelOrder">提交审核</view>

			</view>
		</view>
		<view v-if="currentIndex === 2">
			<view class="head">
				<uv-steps :current="0" inactive-color="#ffffff" active-color="#ffffff">
					<uv-steps-item>
						<template v-slot:icon>
							<view class="renn">
								<view class="rens"></view>
							</view>
						</template>
						<template v-slot:title>
							<text class="ress">01</text>
						</template>
						<template v-slot:desc>
							<text class="ress">提交资料</text>
						</template>
					</uv-steps-item>

					<uv-steps-item>
						<template v-slot:icon>
							<view :class="topCircle() > 1 ? 'renn' : 'renns'">
								<view class="rens"></view>
							</view>
						</template>
						<template v-slot:title>
							<text class="ress">02</text>
						</template>
						<template v-slot:desc>
							<text class="ress">平台审核</text>
						</template>
					</uv-steps-item>
					<uv-steps-item>
						<template v-slot:icon>
							<view :class="topCircle() > 2 ? 'renn' : 'renns'">
								<view class="rens"></view>
							</view>
						</template>
						<template v-slot:title>
							<text class="ress">03</text>
						</template>
						<template v-slot:desc>
							<text class="ress">微信审核</text>
						</template>
					</uv-steps-item>
					<uv-steps-item>
						<template v-slot:icon>
							<view :class="topCircle() > 3 ? 'renn' : 'renns'">
								<view class="rens"></view>
							</view>
						</template>
						<template v-slot:title>
							<text class="ress">04</text>
						</template>
						<template v-slot:desc>
							<text class="ress">入驻成功</text>
						</template>
					</uv-steps-item>
				</uv-steps>
			</view>

			<view class="bun" style=" display: flex; justify-content: center; align-items: center;margin-top: 30%">
				<view class="sh_logo">
					<image v-if="judgeShow()" src="/static/images/news/sh_bj.png" />
					<image v-else src="/static/images/news/deng.png" />
				</view>
			</view>

			<view style=" display: flex; justify-content: center; align-items: center ;margin-top: 35rpx">
				{{ showText() }}
			</view>

			<view v-if="judgeShow()"
				style="display: flex; justify-content: center; align-items: center ;margin-top: 5rpx">
				原因是：{{ form.spot_type == 1 ? shInfo.refuse : shInfo.fail_reason }}
			</view>

			<view v-if="judgeShow()" class="nextStep1" @tap="currentIndex = 0">重新申请</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'
	import func from '@/utils/func.js'
	export default {
		data() {
			return {
				isLongTerm: false,
				isLongTerm1:false,
				imageStyles: {
					width: 170,
					height: 122,
				},
				currentIndex: 0, //选项卡
				currentIndexzi: 0, //选项卡
				currentIndexzi1: 0,
				currentIndexzi3: 0,
				imageValue: [], //上传图片
				items: [],
				
				form: {
					type:0,
					spot_type: 1, //1:商家入驻 2:自提点入驻
					state: 0, // 店铺类型:0=个人,1=企业,2=旗舰
					shopname: '', // 店铺名称
					avatar: '', // 店铺主图
					shop_type: 1, // 商户类型:1为自售卖商家,2为合作商家
					qualification_type: '', // 所属行业
					contact_name: '', // 法人姓名
					contact_id_number: '', // 法人身份证号码
					contact_id_doc_copy: '', // 法人人像面照片
					contact_id_doc_copy_back: '', // 法人国徽面照片
					contact_period_begin: '', // 法人身份证有效期开始时间
					contact_period_end: '', // 超级管理员证件有效期结束时间
					mobile_phone: '', // 法人手机号
					contact_email: '', // 法人邮箱
					subject_type: 'SUBJECT_TYPE_INDIVIDUAL', // 主体类型 SUBJECT_TYPE_INDIVIDUAL：营业执照上的主体类型一般为个体户、个体工商户、个体经营； SUBJECT_TYPE_ENTERPRISE：营业执照上的主体类型一般为有限公司、有限责任公司； SUBJECT_TYPE_GOVERNMENT：包括各级、各类政府机关，如机关党委、税务、民政、人社、工商、商务、市监等； SUBJECT_TYPE_INSTITUTIONS：包括国内各类事业单位，如：医疗、教育、学校等单位； SUBJECT_TYPE_OTHERS： 包括社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等组织
					license_copy: '', // 营业执照照片
					license_number: '', // 注册号/统一社会信用代码
					merchant_name: '', // 营业执照公司名称
					license_address: '', // 注册地址
					license_period_begin: '', // 营业执照有效期限开始日期
					license_period_end: '', // 营业执照有效结束日期 长期填汉字长期
					cert_copy: '', // 主体为政府机关/事业单位/其他组织 登记证书照片
					cert_type: '', // 主体为政府机关/事业单位/其他组织 登记证书类型 当主体为事业单位时，选择此枚举值： CERTIFICATE_TYPE_2388：事业单位法人证书 当主体为政府机关，选择此枚举值： CERTIFICATE_TYPE_2389：统一社会信用代码证书 当主体为社会组织，选择以下枚举值之一： CERTIFICATE_TYPE_2389：统一社会信用代码证书 CERTIFICATE_TYPE_2394：社会团体法人登记证书 CERTIFICATE_TYPE_2395：民办非企业单位登记证书 CERTIFICATE_TYPE_2396：基金会法人登记证书 CERTIFICATE_TYPE_2520：执业许可证/执业证 CERTIFICATE_TYPE_2521：基层群众性自治组织特别法人统一社会信用代码证 CERTIFICATE_TYPE_2522：农村集体经济组织登记证 CERTIFICATE_TYPE_2399：宗教活动场所登记证 CERTIFICATE_TYPE_2400：政府部门下发的其他有效证明文件
					cert_number: '', // 证书号
					company_address: '', // 登记证书的注册地址
					certificate_period_begin: '', // 有效期限开始日期
					certificate_period_end: '', // 有效期限结束日期
					id_card_address: '', // 法人身份证居住地址
					bank_account_type: 'BANK_ACCOUNT_TYPE_CORPORATE', // 账户类型BANK_ACCOUNT_TYPE_CORPORATE：对公银行账户 BANK_ACCOUNT_TYPE_PERSONAL：经营者个人银行卡
					account_number: '', // 银行账号
					account_bank: '', // 银行名称 [‘工商银行’,’交通银行’,’招商银行’,’民生银行’,’中信银行’,’浦发银行’,’兴业银行’,’光大银行’,’广发银行’,’平安银行’,’北京银行’,’华夏银行’,’农业银行’,’建设银行’,’邮政储蓄银行’,’中国银行’,’宁波银行’,’其他银行’];
					bank_address_code: '', // 开户银行省市编码
					bank_branch_id: '', // 17家直连银行无需填写，如为其他银行，则开户银行全称（含支行）和 开户银行联行号二选一 2、需填写银行全称，如”深圳农村商业银行XXX支行”
					bank_name: '', // 银行名
					category_id: "", //分类ID
					address: "", //地址
					time: "",
					pointLat: "",
					pointLng: "",
				},

				bankList: ['工商银行', '交通银行', '招商银行', '民生银行', '中信银行', '浦发银行', '兴业银行', '光大银行', '广发银行', '平安银行', '北京银行', '华夏银行',
					'农业银行', '建设银行', '邮政储蓄银行', '中国银行', '宁波银行', '其他银行'
				],
				bankIndex: 0,
				showExp1: false,
				showExp2: false,
				showExp3: false,

				category_name: "",

				shInfo: null, //审核
			};
		},
		computed: {
			...mapState(["common", 'user']),
		},
		onLoad(options) {
			this.currentIndex = Number(options.curr)
			this.form.type = Number(options.type)
			if (options.info) {
				this.shInfo = JSON.parse(options.info);
			}
			this.form.spot_type = options.index;

			this.getIndustry()

			// if (!!this.user.auth) this.currentIndex = 2
		},
		methods: {
			toggleLongTerm1() {
				this.isLongTerm1 = !this.isLongTerm1
				if (this.isLongTerm1) {
					this.form.license_period_end = '长期';
				} else {
					this.form.license_period_end = '';
				}
			},
			toggleLongTerm() {
				this.isLongTerm = !this.isLongTerm
				if (this.isLongTerm) {
					this.form.contact_period_end = '长期';
				} else {
					this.form.contact_period_end = '';
				}
			},
			/**
			 * 判断是否显示
			 */
			judgeShow() {
				if (this.form.spot_type == 1) { //商家入驻
					if (this.shInfo.shop_status == 4) {
						return true;
					} else {
						return false;
					}
				} else if (this.form.spot_type == 2) { //自提点入驻
					if (this.shInfo.spot_status == 3) {
						return true;
					} else {
						return false;
					}
					if (this.shInfo.spot_status == 6) {
						return true;
					} else {
						return false;
					}
				}
				return false;
			},
			/**
			 * 顶部图标
			 */
			topCircle() {
				let num = 1;
				if (this.form.spot_type == 1) { //商家入驻
					if (this.shInfo.shop_status == 3) {
						num = 4;
					}
					if (this.shInfo.shop_status == 2) {
						num = 2;
					}
				} else if (this.form.spot_type == 2) { //自提点入驻
					if (this.shInfo.spot_status == 1) {
						num = 4;
					}
					if (this.shInfo.spot_status == 5) {
						num = 2;
					}
				}
				return num;
			},
			/**
			 * 显示的文字内容
			 */
			showText() {
				var text = "平台审核中，请耐心等待";

				if (this.form.spot_type == 1) { //商家入驻
					if (this.shInfo.shop_status == 4) {
						text = "审核被驳回"
					} else if (this.shInfo.shop_status == 3) {
						text = "审核通过"
					} else if (this.shInfo.shop_status == 2) {
						text = "平台审核中，请耐心等待"
					} else if (this.shInfo.shop_status == -1) {
						text = "审核被驳回"
					}
				} else if (this.form.spot_type == 2) { //自提点入驻
					if (this.shInfo.spot_status == 6) {
						text = "审核被驳回"
					} else if (this.shInfo.spot_status == 5) {
						text = "平台审核中，请耐心等待"
					} else if (this.shInfo.spot_status == 3) {
						text = "审核被驳回"
					} else if (this.shInfo.spot_status == 1) {
						text = "审核已通过"
					}
				}

				return text;
			},
			/**
			 * 分类选择
			 */
			onCategoryChange(e) {
				console.log("AAAAAA", e);
				const index = e.detail.value;
				const item = this.common.modulesData.categoryModules[index];
				this.form.category_id = item.id;
				this.category_name = item.name;
			},
			/**
			 * 店铺地址
			 */
			onChooseAddress() {
				uni.chooseLocation({
					success: res => {
						this.form.pointLat = res.latitude;
						this.form.pointLng = res.longitude;
						this.form.address = res.address;
					}
				})
			},

			clearH() {
				this.form.qualification_type = '';
				console.log(
					1231
				);
			},
			getIndustry() {
				uni.request({
					url: '/wanlshop/product/industry',
					method: 'GET',
					success: res => {
						this.items = res.data
						console.log('--==tis', this.items)
						console.log('--==-succ', res.data)
					}
				})
			},
			onnodeclick(e) {
				console.log('-=-=-=eee', e)
				this.form.qualification_type = e.text
			},
			change(e, field) {
				if (field == 'account_bank') {
					this.form.account_bank = this.bankList[e.detail.value]
				} else {
					this.form[field] = e.detail.value
				}
				console.log('-=-=-=e', e)
			},
			formSubmit(e) {
				console.log('-=-=-=e', e)
				tihs.nextStepjump()
			},

			// 获取上传状态
			select(e, field) {
				console.log("选择文件：", e);
				const filePath = e.tempFilePaths[0];
				uni.getFileInfo({
					filePath: filePath,
					success: (fileInfo) => {
						const maxSize = 2 * 1024 * 1024; // 2MB
						if (fileInfo.size > maxSize) {
							uni.showToast({
								title: '图片大小不能超过2MB',
								icon: 'none'
							});
							e.tempFilePaths.length = 0;
							return;
						} else {
							func.upload(filePath, res => {
								this.form[field] = res.code.url;
								console.log('-=-=-=res', res);
							});
						}

					},
					fail: (error) => {
						console.error('获取文件信息失败：', error);
					}
				});
				// func.upload(e.tempFilePaths[0], res => {
				// 	this.form[field] = res.code.url
				// 	console.log('-=-=-=res', res)
				// })
			},
			del(e) {
				console.log('-=-=-=e', e)
			},
			//点击切换选项卡
			dun(index) {
				this.currentIndex = index;
			},
			//上一步
			previousStep() {
				if (this.currentIndex > 0) {
					this.currentIndex--;
				}
				console.log("已切换到选项卡:", this.currentIndex);
			},
			//下一步
			nextStepjump() {
				console.log('-=-==foirm', this.form)
				this.currentIndex = Math.min(this.currentIndex + 1, 3);
				if (this.currentIndex == 2) {
					uni.request({
						url: "/wanlshop/shop/user_status",
						method: "POST",
						data: {
							type: this.form.spot_type
						},
						success: res => {
							console.log(res, '9888888888888');
							uni.hideLoading()
							var status;
							if (this.form.spot_type == 1) {
								status = res.data.shop_status;
								if (res.data.shop_status == 5) {
									this.shInfo.refuse = res.data.wx_status

								}
							} else if (this.form.spot_type == 2) {
								status = res.data.spot_status;
								if (res.data.spot_status == 3) {
									console.log('1111111111111111111dsa');
									this.shInfo.fail_reason = res.data.wx_status

								}
							}

							this.$wanlshop.to(
								`/pages/user/applicationProgress/applicationProgress?curr=2&index=${this.form.spot_type}&info=${JSON.stringify(res.data)}`
							);


						}
					})
				}
				console.log("已切换到选项卡:", this.currentIndex);
			},
			xuangxiang(index) {
				this.currentIndexzi = index;
			},
			xuangxiang1(index) {
				console.log(1);
				this.currentIndexzi1 = index;
			},
			xuangxiang2(index) {
				console.log(2);
				this.currentIndexzi1 = index;
			},
			xuangxiang3(index) {
				console.log(2);
				this.currentIndexzi3 = index;
			},
			// 商家入驻
			async cancelOrder() {
				console.log(this.form, '989dsadasdas');
				if(this.form.type == 0){
					if (!this.form.license_copy) return func.msg('请重新上传营业执照照片')
					if (!this.form.account_number) return func.msg('请输入银行账号')
					if (!this.form.account_bank) return func.msg('请选择银行名称')
				}
				if (!this.form.shopname) return func.msg('请输入店铺名称')
				if (!this.form.avatar) return func.msg('请上传店铺主图')
				if (!this.form.qualification_type) return func.msg('请选择所属行业')
				if (!this.form.contact_name) return func.msg('请输入法人姓名')
				if (!this.form.contact_id_number) return func.msg('请输入法人身份证号')
				if (!this.form.contact_id_doc_copy) return func.msg('请重新上传法人人像面照片')
				if (!this.form.contact_id_doc_copy_back) return func.msg('请重新上传法人国徽面照片')
				if (!this.form.contact_period_begin) return func.msg('请选择身份证开始时间')
				if (!this.form.contact_period_end) return func.msg('请选择身份证结束时间')
				if (!this.form.mobile_phone) return func.msg('请输入法人手机号')
				if (!func.isMobile(this.form.mobile_phone)) return func.msg('法人手机号格式错误')
				if (!this.form.contact_email) return func.msg('请输入法人邮箱')
				if (!this.form.category_id) return func.msg('请选择商品分类')
				console.log(this.form, '989dsadasdas');
				
				await uni.request({
					url: '/wanlshop/user/merRegistration',
					method: 'POST',
					// header: headers,
					data: this.form,
					success: res => {
						console.log('--==-succ', res)
						this.nextStepjump()
					}
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	/deep/.uv-steps-item__wrapper {
		background-color: transparent !important;

	}

	/deep/.uv-steps-item__line::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -39%);
		width: 99%; // 增加线条宽度以扩展长度
		height: 1px;
		background-color: #ffffff; // 确保颜色与组件设置的颜色一致
	}

	.head {
		margin-top: 20rpx;
		padding: 25rpx;
		background-color: #E60012;

		.renn {
			margin-left: 10rpx;
			width: 30rpx;
			height: 30rpx;
			background-color: #EF7C85;
			border-radius: 50%;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.renns {
			margin-left: 10rpx;
		}

		.rens {
			text-align: center;
			width: 15rpx;
			height: 15rpx;
			background-color: white;
			border-radius: 50%;
		}

		.ress {
			color: white;
		}
	}

	/deep/ .input-value-border {
		margin-left: 35rpx;
		width: 300rpx;
		border: none !important;
	}

	.page {
		padding: 25rpx;
		background-color: #f6f6f6;

		.tabs {
			margin-top: 30rpx;
			display: flex;

			border: 1px solid red;
			border-radius: 16rpx;

			/* gap: 10px; */
		}

		.tab.active {
			background-color: red;
			color: white;
			border-radius: 16rpx;
		}

		.tab {
			width: 232rpx;
			height: 80rpx;
			flex: 1;

			text-align: center;
			line-height: 80rpx;

			cursor: pointer;
		}

		.tab span {
			padding: 5px 10px;
			border-bottom: 2px solid transparent;
		}

		.tab-content {
			margin-top: 10px;
			padding: 15px;
			border: 1px solid #ccc;
			background: #ffffff;
			border-radius: 16rpx;

			.picker {
				display: flex;
				margin-top: 25px;
				margin-left: 20rpx;

				.title {
					line-height: 70rpx;
				}
			}
		}

		.tab-content1,
		.tab-content2,
		.tab-content3,
		.tab-content4,
		.tab-content5,
		.tab-content6 {
			margin-top: 10px;
			padding: 15px;
			border: 1px solid #ccc;
			background: #ffffff;
			border-radius: 16rpx;

			.text {
				font-family: Source Han Sans CN;
				font-weight: 600;
				font-size: 30rpx;
				color: #222222;
				line-height: 37rpx;
			}

			.information {
				font-weight: bold;
			}

			//子页面选项卡
			.optionsCardPage {
				display: flex;
				gap: 35rpx;
				margin-top: 25rpx;

				.optionsCardPage1 {
					width: 300rpx;
					height: 76rpx;
					border-radius: 5rpx;
					text-align: center;
					line-height: 76rpx;
					color: black;
					font-family: PingFang SC;
					font-weight: 500;
					font-size: 30rpx;
					background: #ffffff;
					border-radius: 5rpx;
					border: 1px solid #dadada;
				}

				.optionsCardPage1.active {
					background-color: red;
					color: white;
					border-radius: 5rpx;
				}
			}

			.zitab {
				.businessLicense {
					margin-top: 30rpx;
					//border: 1px solid red;
				}

				.legalPerson {
					//color: red;
					margin-top: 25rpx;
					font-weight: bold;
				}
			}

			.sho {
				font-weight: bold;
				display: flex;
				align-items: center;
			}

			.explain {
				color: #cdcdcd;
				margin-top: 20rpx;
			}

			.shjc {
				display: flex;
				// margin-top: 30rpx;
				border-bottom: 1px solid #d8d8d8;
				// padding-bottom: 40rpx;
				padding: 25rpx 0rpx;
				align-items: center;
			}

			.shj {}

			.icon {
				padding-left: 10rpx;
			}

			.oun {
				padding-left: 10rpx;
			}
		}

		.tab-content5 {
			.shjh {
				// color: red;
				margin-top: 10rpx;
			}

			.corporateAccount {
				border: 1px solid red;
				display: flex;
			}
		}

		//   表单内容
		.input {
			// margin-top: 30rpx;
			display: flex;
			border-bottom: 1px solid #d8d8d8;
			padding: 25rpx 15rpx;
			align-items: center;

			&:first-child {
				margin-top: 0;
			}

			.title {
				line-height: 50rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 30rpx;
				color: #121212;
				//   line-height: 37rpx;
				min-width: 125rpx;
			}

			.uni-input {
				padding-left: 40rpx;
				line-height: 50rpx;
				//   padding-top: 5rpx;
			}
		}

		.pickers {
			//border: 1px solid red;
			margin-top: 20rpx;
			display: flex;

			justify-content: space-between;
			gap: 45rpx;
			text-align: center;

			.reddf {
				margin-top: 20rpx;
				//border: 1px solid red;
			}

			.ddff {}

			.khg {}

			.ren {
				flex: 1;
			}

			.title {
				line-height: 60rpx;
			}
		}

		.storeMainImage {
			padding: 15rpx;
			margin-top: 20rpx;

			.ren {
				// border: 1px solid red;
				margin-top: 30rpx;
			}

			.title {
				line-height: 50rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 30rpx;
				color: #121212;
				//   line-height: 37rpx;
				min-width: 125rpx;
			}
		}

		.nextStep {
			border: 1px solid red;
			text-align: center;
			color: white;
			width: 650rpx;
			height: 96rpx;
			color: red;
			border-radius: 16rpx;
			line-height: 96rpx;
			margin: 0 auto;
			margin-top: 15px;
			/* 设置顶部外边距 */
		}

		.nextStep1 {
			border: 1px solid red;
			text-align: center;
			background-color: red;
			color: white;
			width: 650rpx;
			height: 96rpx;
			background: #f23030;
			border-radius: 16rpx;
			line-height: 96rpx;
			margin: 0 auto;
			margin-top: 15px;
			/* 设置顶部外边距 */
		}
	}

	.picker-view {
		padding-left: 40rpx;
		font-size: 30rpx;
		color: #808080;
	}

	/deep/.input-value,
	/deep/.placeholder {
		font-size: 30rpx;
		padding: 0 10rpx 0 0
	}

	.sh_logo {
		width: 150rpx;
		height: 150rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}
	/deep/.uni-radio-input{
		    width: 17px;
		    height: 17px;
	}
	/deep/ uni-radio::before{
		margin-top: -8px;
		    right: 1px;

	}
</style>